There are cases where it is required to rotate a machining profile on an X-Y plane about a predetermined rotational axis and perform machining in accordance with the profile at the position to which it has been rotated. For example, as shown in FIG. 4, there are cases where a figure (indicated by the dashed line) PT of a machining profile on the X-Y plane is affixed to an inclined surface ISF of a workpiece WK having an inclination of angle .theta. with respect to the X-Y plane, with machining being performed in accordance with the affixed profile PT'.
With reference to FIG. 4, the conventional practice in such case is to create NC path data for machining in accordance with the profile PT in a predetermined program coordinate system (X-Y plane); obtain a central axis vector (i.sub.o,j.sub.o,k.sub.o) along the axis of rotation (X axis), a rotational center point P.sub.co (x.sub.co,y.sub.co,z.sub.co) on the axis of rotation and the rotational angle .theta.; subject the position data included in the NC path data to a coordinate transformation based on a coordinate transformation matrix determined by the central axis vector, the rotational center point and the rotational angle; control the position of a tool based on position data obtained as a result of the coordinate transformation; and perform machining in accordance with a command by moving the tool along the path PT' obtained as a result of the rotation by angle .theta. about the rotational axis (X axis).
There are also cases in which, when the profile on the X-Y plane is rotated through predetermined angles .theta., .phi. about two respective arbitrary rotational axes, it is desired to perform machining in accordance with the profile at the position obtained as a result of these rotations. For example, with reference to FIG. 5, there are cases where the X-Y plane is rotated by .theta. about the X axis, a plane X.sub.1 -Y.sub.1 obtained by this rotation is rotated by .phi. about a Y.sub.1 axis to obtain a plane X.sub.2 -Y.sub.2, the matching profile figure PT in the X-Y plane is affixed in the plane X.sub.2 -Y.sub.2, and machining is performed in accordance with the affixed profile PT" using NC path data defined in terms of the X-Y plane.
However, in the prior art, such machining on a plane obtained as the result of two rotations is possible only when the rotational center point of the initial rotational axis and the rotational center point of the next rotational axis coincide (in FIG. 5, the centers of rotation coincide since both are P.sub.co). In other words, if the centers of rotation coincide, then a coordinate transformation is applied to coordinates (x,y,z) in accordance with the equation ##EQU1## to obtain post-rotational coordinates (x',y',z'), and machining in the post-rotational plane is possible using the last-mentioned coordinates. It should be noted that [M.sub.1 ], [M.sub.2 ] are matrices based on first and second rotations.
Conventionally, however, if the machining profile PT in the X-Y plane is affixed on a plane (see plane PL in FIG. 6) obtained by two rotations in a case where the rotational center points do not coincide, machining in accordance with the profile PT" is impossible using the path data for the X-Y plane.